#import "ZealotRippleController.h"
        
#import "ZealotRippleModel.h"
#import "ZealotRippleCell.h"
#import "Masonry.h"

@interface ZealotRippleController () <UICollectionViewDataSource, UICollectionViewDelegate>

@property (nonatomic, strong) UICollectionView *kaleidoscopeRadiantCollectionView;
@property (nonatomic, strong) NSMutableArray *journeyModels;

@end

@implementation ZealotRippleController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self blossomOnyxInitlyout];
	[self dazzleGraspXenophileloadData];
}


//: 懒加载数据模型数组
- (NSMutableArray *)journeyModels {
	if (!_journeyModels) {
		_journeyModels = [NSMutableArray array];
	}
	return _journeyModels;
}

//: 初始化页面UI
- (void)blossomOnyxInitlyout {
	[self.view addSubview:self.kaleidoscopeRadiantCollectionView];
	[self.kaleidoscopeRadiantCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.edges.equalTo(self.view);
	}];
}


- (UICollectionView *)kaleidoscopeRadiantCollectionView {
    if (!_kaleidoscopeRadiantCollectionView) {
        UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
        flowLayout.minimumLineSpacing = 10;
        flowLayout.minimumInteritemSpacing = 10;
        flowLayout.itemSize = CGSizeMake(100, 100);
        flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
        
        _kaleidoscopeRadiantCollectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
        _kaleidoscopeRadiantCollectionView.backgroundColor = UIColor.clearColor;
        _kaleidoscopeRadiantCollectionView.delegate = self;
        _kaleidoscopeRadiantCollectionView.dataSource = self;
        _kaleidoscopeRadiantCollectionView.showsHorizontalScrollIndicator = NO;
        _kaleidoscopeRadiantCollectionView.showsVerticalScrollIndicator = NO;
        [_kaleidoscopeRadiantCollectionView registerClass:[ZealotRippleCell class] forCellWithReuseIdentifier:NSStringFromClass([ZealotRippleCell class])];
    }
    return _kaleidoscopeRadiantCollectionView;
}

//: 获取数据模型
- (void)dazzleGraspXenophileloadData {
	
}

#pragma mark - UICollectionView DataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return self.journeyModels.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    ZealotRippleCell *curious = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([ZealotRippleCell class]) forIndexPath:indexPath];
    return curious;
}

#pragma mark - UICollectionView Delegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    //: collectioncell 点击
}


@end
